Skip to content

feat(backup): one vault directory per stacklet - #88

Merged
arthware-dev merged 2 commits into
mainfrom
feat/backup-vault-layout
Sep 12, 2026
Merged

arthware-dev merged 2 commits into
mainfrom
feat/backup-vault-layout

Conversation

@arthware-dev

Copy link
Copy Markdown
Contributor

Backup sources now land in data/<stacklet>/<name> on the vault: data/photos/library instead of data/photos-library. Everything belonging to one stacklet restores from one place, and a hyphen inside a stacklet id or a source name is no longer ambiguous.

Existing vaults keep working untouched. A sync that finds the old flat directories goes on appending to them and prints one line per source pointing at the new command, so nothing is ever copied twice.

stack backup migrate does the one-time rename, --dry-run to preview. It renames the directories rather than their contents, so a 65k-file photo library moves in about a second and the immutable flags survive. Run it with the disk mounted, right after a sync.

The vault gave every source a flat directory, data/photos-library. Both
halves of a source id can contain hyphens, so that name cannot be split
back into stacklet and source. Sources now land under their stacklet:
data/photos/library, data/messages/synapse, which also puts everything
that has to be restored together in one place.

Disks written by 0.3.0-beta.3 and earlier go on working. A sync uses
whichever directory it finds, so nothing is ever copied twice and no
vault has to be touched at all. `stack backup migrate` performs the
one-time rename when the household is ready; it moves directories
rather than their contents, so no data is copied and the files keep the
immutable flag that makes the vault append-only.
The immutable-flag test shells out to chflags, which only exists on
BSD, so it failed on the Linux CI runner. The rest of the file is
plain path handling and still runs everywhere.
@arthware-dev
arthware-dev merged commit ef48d09 into main Sep 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant